<?php
use common\helps\formatMoney;
use yii\widgets\LinkPager;
use yii\helpers\Url;
$this->title = "APMS项目管理系统-资产包管理";
$this->registerMetaTag(['http-equiv' => 'X-UA-Compatible', 'content' => 'IE=edge; charset=UTF-8']);
$this->registerMetaTag(['name' => 'renderer', 'content' => 'webkit']);
$this->registerMetaTag(['name' => 'author', 'content' => 'wang']);
$this->registerMetaTag(['name' => 'viewport', 'content' => 'width=device-width, initial-scale=1.0,user-scalable=no,maximum-scale=1.0,minimum-scale=1.0']);

$this->registerCssFile('/css/bootstrap.min.css');
$this->registerCssFile('/css/base.css');
$this->registerCssFile('/css/header-footer.css');
$this->registerCssFile('/css/projectManagement.css');
$this->registerCssFile('/css/paging.css');
$this->registerCssFile('@web/css/select2.min.css', ['depends' => ['backend\assets\AppAsset'], 'position' => $this::POS_HEAD]);

$this->registerJsFile('/js/common.js');
$this->registerJsFile('/js/jquery.min.js');
$this->registerJsFile('/js/select2.min.js');
$this->registerJsFile('/js/projectManagement.js');

//$countryList = \common\models\Country::getTitleList();
?>
<style type="text/css">
 tr th{
        cursor:pointer;
    }.upFixe {
    width: 89%;
    background: #fff;
}
.wrap > .container-fluid > .container {
        /*width: 100%!important;*/
       padding: 0;
    }

 /** 联想搜索 **/
 .select2-results__message{ display: none; }
 .myBagSeachBox .queryBox .shenglabel { margin-right: 6px;}
 .myBagSeachBox .queryBox .zichanleixing { margin-left: 0;  margin-top: 20px; }
 #city + .select2-container{ margin-left: 20px; }

</style>


	<!--一键置 顶-->

	<a href="#" class="clicktop" title="返回顶部">
		<!--<img src="image/common/clickTop.png" alt=""  />-->
	</a>

	<!-- 导航区结束 -->
	<!--资产包详情搜索部分开始-->
	<div class="myBagSeachBox">
		<div class="container" style="position: relative;">
			<div class="top">
				<a href="<?php  echo Url::toRoute('site/index',true);?>" style="color:#000">办公大厅</a>
				<a href="jascript:;" class="pagedetails"> >&nbsp;资产包管理</a>
			</div>

			<div id="myTabContent" class="tab-content">
				<div class="tab-pane fade in active" id="myPortfolioPackage">
					<div class="box">
						<input class="search" list="assetPackageTitle"  type="search" placeholder="请输入您要查找的资产包名称关键词" value="<?= Yii::$app->request->get('keyWords','');?>"/>
							<datalist id="assetPackageTitle">

							</datalist>
							
						<span class="searchText">请输入您要查找的资产包名称关键词</span>
						<!--<img src="/image/projectManagement/search.png" class="searchImg"/>-->
						<span class="dianLiang pull-right">
							<strong class="img">
							</strong>
							<!--<span class="pull-right">只显示亮点项目</span>-->
							<div class="shouqi" style="">
								 收起查询条件
							</div>
							<div class="zhankai" style="display: none;">
								 展开查询条件
							</div>
						</span>
					</div>
					
				</div>
				
			</div>
			
			
			<div class="queryBox">
				<label for="" class="benjin">本金数额
                <?php $moneyNum=\common\helps\profiles::getPackagePrice();?>
				<select id="benjin">
                    <?php
                    $moneyID = Yii::$app->request->get('principal',0);
                    foreach ($moneyNum as $k =>$v) {
                        if ($moneyID==$k){
                            echo "<option selected  value=".$k.">".$v['name']."</option>";
                        }else{
                            echo "<option  value=".$k.">".$v['name']."</option>";
                        }
                    }
                    ?>
				</select>
                </label>

                <label for="" class="zichanbaobei">资产包类别
                <?php $groupNum=\common\helps\profiles::getCateGory();?>
                <select id="zichanbaoleixing">
                    <option value="0">全部</option>
                    <?php
                    $categoryID = Yii::$app->request->get('category',0);
                    foreach ($groupNum as $k =>$v) {
                        if ($categoryID==$k){
                            echo "<option selected  value=".$k.">".$v['name']."</option>";
                        }else{
                            echo "<option  value=".$k.">".$v['name']."</option>";
                        }
                    }
                    ?>
				</select>
                </label>
                <label for="" class="dangqian">当前状态
                <?php $groupState=Yii::$app->params['package_state']; ?>
                <select id="dangqianzhuantian">
                    <?php
                    $packageStateID = Yii::$app->request->get('packageState',0);
                    if ($packageStateID==0){
                        echo "<option selected  value='0'>全部</option>";
                    }else{
                        echo "<option  value='0'>全部</option>";
                    }
                    foreach ($groupState as $k =>$v) {
                        if ($packageStateID==$k){
                            echo "<option selected  value=".$k.">".$v."</option>";
                        }else{
                            echo "<option  value=".$k.">".$v."</option>";
                        }
                    }
                    ?>
				</select>
                </label>
                <label for="" class="zichanleixing">资产包类型
                <?php $groupType=\common\helps\profiles::getPackageType();?>
                <select id="zichanleixing">
                    <?php
                    $packageTypeID =  Yii::$app->request->get('packageType',0);
                    foreach ($groupType as $k =>$v) {
                        if ($packageTypeID==$k){
                            echo "<option selected  value=".$k.">".$v['name']."</option>";
                        }else{
                            echo "<option  value=".$k.">".$v['name']."</option>";
                        }
                    }
                    ?>
				</select>
                </label>
                <label for="" class="shangchuanren">上传人
					<input type="search" id="shangchuanren" list="up-load" value="<?= Yii::$app->request->get('owner','')?>"/>
					 <datalist id="up-load">
                         <?php
                         foreach ($userTeam as $k=>$v){
                             echo "<option >".$v['realname']."</option>";
                         }
                         ?>
		            </datalist>
				</label>
				<label for="" class="formBox clearfix">
						<label   class="shenglabel" for="">省份地区</label>
                    <?php
                    $provinceID =  Yii::$app->request->get('province',0);
                    ?>
						<select class="sheng" name="" id="province">

                            <option  value='0' <?= $provinceID==0?'selected':''?>>全部</option>";

                            <?php
                                foreach ($provinceData as $k => $v) {
                                    if ($provinceID==($k+1) && $provinceID!=0){
                                        echo "<option selected data-id=".$v['id']." value=".$v['id'].">".$v['title']."</option>";
                                    }else{
                                        echo "<option  data-id=".$v['id']." value=".$v['id'].">".$v['title']."</option>";
                                    }
                                }
                            ?>
						</select>
						省
						<select class="shi" name="" id="city">
                            <option value='' selected=''>全部</option>
                        </select>
						市
				</label>
			
				<label for="" class="tuandui">团队成员
					
					<input type="search" id="tuandui" list='team' value="<?= Yii::$app->request->get('teams','')?>"/>
					 <datalist id="team">
                         <?php
                         foreach ($userTeam as $k=>$v){
                             echo "<option >".$v['realname']."</option>";
                         }
                         ?>
		            </datalist>
				</label>

				<label for="" class="zongjian">项目总监
					<input type="search" id="zongjian" list="majordomo" value="<?= Yii::$app->request->get('leader','')?>"/>			
					<datalist id="majordomo">userTeamLeardn
                        <datalist id="team">
                            <?php
                            foreach ($userTeamLeardn as $k=>$v){
                                echo "<option >".$v['realname']."</option>";
                            }
                            ?>
                        </datalist>
		            </datalist>
				</label>
                <label for="" class="tuandui ziChan">资产包负责人
                    <input type="search" id="charge" list='team' value="<?= Yii::$app->request->get('charge','')?>"/>
                    <datalist id="team">
                        <?php
                        foreach ($userTeam as $k=>$v){
                            echo "<option >".$v['realname']."</option>";
                        }
                        ?>
                    </datalist>
                </label>
			</div>
			<input type="button" value="清除查询条件"  class="reset" id="reset"/>
			<input id="chaxun" type="button" value="查询"  class="inputT"/>
				<!--资产包详情列表结开始-->
			<div class="row">
				<div class="top clearfix">
					<!--<button class=" pull-right">修改访问权限</buttont>-->
					<button class = "myactive uploadBut pull-left" onclick="javascript:window.location.href = '/package/index';">上传资产包</button>
				</div>
			    <table class="mytable tableRaius tableRaiusTh" border="0" cellspacing="0" cellpadding="0">

                    <?php
                    if (empty($dataPackage['data']['res'])){
                        echo <<<NULLPAGE
<div class="defaultPage">
        <div class="defaultPage-nothing">
            <img src="/image/defaultPage/nothing.png" style='width:100%'>
        </div>
    </div>
NULLPAGE;
                    }else{
                        echo <<<NULLPAGE
                        <thead class="thead-normal">
			    		<tr class="top tableTh">
				    		<!--<th class="input">类别</th>-->
				    		<th class="name" onclick="orderGroup(1)">资产包名称</th>
				    		<th class="bianhao" onclick="orderGroup(3)">资产包类型</th>
				    		<th class="diqv" onclick="orderGroup(5)">地区</th>
				    		<th class="benjin" onclick="orderGroup(7)"> 本金</th>
				    		<th class="lixi" onclick="orderGroup(9)">利息</th>
				    		<th class="shengyu" onclick="orderGroup(11)">剩余户数</th>
				    		<th class="upload" onclick="orderGroup(13)">资产包负责人</th>
				    		<th class="uploadTime" onclick="orderGroup(15)">上传时间</th>
				    		<th class="dangqian" onclick="orderGroup(17)">当前状态</th>
				    		<th class="xiangqing">详情</th>
				    	</tr>
			    	</thead>
			    	<thead class="thead-fixed" style="display: none;border-bottom: 1px solid #E2E2E2;">
			    		<tr class="top tableTh ">
				    		<!--<th class="input">类别</th>-->
				    		<th class="name" onclick="orderGroup(1)">资产包名称</th>
				    		<th class="bianhao" onclick="orderGroup(2)">资产包类型</th>
				    		<th class="diqv" onclick="orderGroup(3)">地区</th>
				    		<th class="benjin" onclick="orderGroup(4)"> 本金</th>
				    		<th class="lixi" onclick="orderGroup(5)">利息</th>
				    		<th class="shengyu" onclick="orderGroup(6)">剩余户数</th>
				    		<th class="upload" onclick="orderGroup(7)">资产包负责人</th>
				    		<th class="uploadTime" onclick="orderGroup(8)">上传时间</th>
				    		<th class="dangqian" onclick="orderGroup(9)">当前状态</th>
				    		<th class="xiangqing">详情</th>
				    	</tr>
			    	</thead>

NULLPAGE;
                    foreach ($dataPackage['data']['res'] as $k => $v) {
                        $ownerName = '--';
                        if (!empty($v['owner'])){
                            $ownerName = \common\models\User::findIdentity($v['owner']);
                            if (!empty($ownerName->realname)){
                                $ownerName = $ownerName->realname;
                            }
                        }
                        $packageId = !empty($v['id'])?$v['id']:"";
                        $categoryVal   = !empty($v['category'])?$categoryName[$v['category']]['name']:"";
                        $getPackageVal = !empty($v['type'])?$getPackageName[$v['type']]['name']:'';
                        $title         = !empty($v['title'])?$v['title']:"";
                        $titleS         = !empty($v['title'])?mb_substr($v['title'],0,15):"";
                        $provincename  = !empty($v['provincename']['title'])?$v['provincename']['title']:'';
                        //$cityname       = !empty($v['cityname']['title'])?$v['cityname']['title']:'';
//                        if ($v['city'] != '') {
//                            $arr = explode(',', $v['city']);
//                            $array = array();
//                            if (!empty($arr)) {
//                                foreach ($arr as $value) {
//                                    $array[] = $countryList[(int)$value];
//                                }
//                            }
//                            $cityname = join('、', $array);
//                        } else {
//                            $cityname = '';
//                        }
                        $cityname = !empty($v['cityNameList'])?$v['cityNameList']:'';

                        $principal = $v['principal'];
                        $principal = !empty($principal)?formatMoney::format_money($principal,2):0.00;
                        $interest       = $v['interest'];
                        $interest      = !empty($interest)?formatMoney::format_money($interest,2):0.00;
                        $hushu         = !empty($v['hushu'])?$v['hushu'].'户':'0户';
                        $LeaderGroupName = !empty($v['LeaderName'])?$v['LeaderName']['bumen']:'';
                        $LeaderName = !empty($v['LeaderName'])?$v['LeaderName']['realname']:$ownerName;
                        $LeaderManagerName = !empty($v['LeaderManagerName'])?'-'.$v['LeaderManagerName']['realname']:'';
                        $due_diligenceName = '';
                        foreach ($v['due_diligencename'] as $k1 => $v1) {
                            $due_diligenceName.= $v1['realname'].',';
                        }
                        $due_diligenceName = mb_substr($due_diligenceName, 0, mb_strlen($due_diligenceName) - 1);
                        $getPakcageStateName = !empty($v['state'])?Yii::$app->params['package_state'][$v['state']]:'--';
                        $created_at = !empty($v['created_at'])?  date('Y/m/d',strtotime($v['created_at'])):'';
                        $banMonth = strtotime("-15 day");
                        $created_at_c = strtotime($v['created_at']);
                        $newHtml = '';
                        if ($created_at_c > $banMonth){
                            $newHtml = "<span class='activeNew'></span>";
                        }
                        $isView = \backend\controllers\DtActionFilter::checkPackage('package_view',$packageId);
                        if ($isView){
                            $viewHtml =  <<<ISVIEW
                		    <a href="/package/detail-info?packageid=$packageId" target="_blank">查看</a>
ISVIEW;
                            $link = <<<VIEWTITLE
<a href='/package/detail-info?packageid=$packageId' target='_blank'>
			    				<span class="txt-cut" title='$title'>
			    				$newHtml
			    				$titleS
			    				</span>
			    			</a>
VIEWTITLE;
                        }else{
                            $viewHtml =  <<<ISVIEW
<a href="javascript:void(0)" class="fangwenSQ" data-packageid="$packageId" data-title='$title'>申请访问</a><br>
ISVIEW;
                            $link = <<<VIEWTITLE
<a href='#'>
			    				<span class="txt-cut" title='$title'>
			    				$newHtml
			    				$titleS
			    				</span>
			    			</a>
VIEWTITLE;
                        }
                        echo <<<PackageInfo
 	<tr>
			    		
			    		<td>
			    			$link
			    			
			    			
			    		</td>
			    		<td>
			    			<span class="txt-cut" title='$getPackageVal'>
			    				$getPackageVal
			    			</span>
			    			
			    		</td>
			    		
			    		<td>
			    			<span class="txt-cut" title='$provincename&nbsp;&nbsp;$cityname'>
			    				$provincename&nbsp;&nbsp;$cityname
			    			</span>
			    		</td>
			    		<td>
			    			<span class="txt-cut" title='$principal'>
			    				$principal
			    			</span>
			    		</td>
			    		<td>
			    			<span class="txt-cut" title='$interest'>
			    				$interest
			    			</span>
			    			
			    		</td>
			    		<td>
			    			<span class="txt-cut" title='$hushu'>
			    				$hushu
			    			</span>
			    		</td>
			    		<td>
			    			<span class="txt-cut" title='$LeaderGroupName -$LeaderName'>
			    				$LeaderName
			    			</span>
			    		</td>
			    		<td>
			    			<span class="txt-cut" title='$created_at'>
			    				$created_at
			    			</span>
			    		</td>	
			    		<td>
			    			<span class="txt-cut project " title="$getPakcageStateName">$getPakcageStateName</span>
			    		</td>
			    	
			    		<td>
			    	        $viewHtml
			    		</td>
			    	</tr>
PackageInfo;

                    }
                    }
                    ?>

			    </table>

                <div class="box-body">
                    <div class="row">
                        <div class="page">
                    <?= LinkPager::widget([
                        'pagination' => $pages,
                        'nextPageLabel' => '下一页',
                        'prevPageLabel' => '上一页',
                        'firstPageLabel' => '首页',
                        'lastPageLabel' => '尾页',
                    ]); ?>
                        </div>
                        <div class="pageBox">
                            <div class="pagination">
                        <span class="pageT"></span> 每页 
                        <?php $pageNum = \common\helps\profiles::getPageNum();?>
						<a id="list">
                            <?php $getPageNum = Yii::$app->request->get('limit',20) ?>
							<span class="number"><?= empty($getPageNum)?$pageNum[0]:$getPageNum?></span>
							<ul class="pageTotalBox">
                                <?php

                                foreach ($pageNum as $k => $v) {
                                    echo "<li class='pageNum'>".$v."</li>";
                                }
                                ?>
							</ul>
							<b class="caret"> </b>
						</a>
						行
					<span class="totalSize"> 共<span><?= $count;?></span>条记录
                        </div>
                        </div>
                    </div>
                </div>
			</div>
			
		</div>
	</div>



<!-- Modal -->
<div class="modal fade" id="shenqingFW" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <?= $this->render('../my-package/fangwen');?>
</div>
<!-- 模态窗口  结束!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

	<script type="text/javascript">
        var isDatas = "<?= !empty($dataPackage['data']['res'])?1:0?>";
        var getProvinceID = '<?=  $provinceID =  Yii::$app->request->get('province',0);?>';
        var cityID = '<?=  $provinceID =  Yii::$app->request->get('city',0);?>';
        var pageNumOne = '<?= $pageNumOne?>';
		$(function(){
			var w = $(".container").width();
			// 业内导航
			$(".edit-tabs-li1").click(function(){
				$(this).addClass("active").children(".edit-tabs-ul2").show();
				$(this).siblings().removeClass("active").children(".edit-tabs-ul2").hide();
	
			});
	
			// 详情按钮
			$(".details-btn").click(function(){
		    	$(this).addClass("btn-primary").siblings().removeClass("btn-primary").addClass("btn-default");
		    });
			var province = getProvinceID;
            $("#province").change(function () {
                getProvinceID = $(this).val();
                var provinceId = $(this).val();
                if (getProvinceID!=0){
                    $.get('/search-package/ajax-city',{'provinceID':provinceId},function (res) {
                        var resData = JSON.parse( res );
                        if (resData.code==200){
                            rendering(resData.data.res);

                        }else{
                            alert("错误")
                        }
                    })
                }else{
                    var cityHtml0="<option value='' selected=''>全部</option>";
                    $("#city").html("");
                    $("#city").append(cityHtml0);
                }
            })
            //刷新页面加载城市数据
            $().ready(function(){
                if (getProvinceID != 0){
                    province = $(this).val();
                    if (province==0){
                        var city = 0;
                    }else{
                        var city = cityID;
                    }
                    $.get('/search-package/ajax-city',{'provinceID':getProvinceID},function (res) {
                        var resData = JSON.parse( res );
                        if (resData.code==200){
                            rendering(resData.data.res);
                        }else{
                            alert("错误")
                        }
                    })
                }
            })
            function rendering(res) {
                var cityHtml = "";
                $(res).each(function(i,e){
                    var title = e.title;
                    var id    = e.id;
                    if (cityID==id){
                        cityHtml+= "<option selected value='"+id+"'>"+title+"</option>";
                    }else{
                        cityHtml+= "<option value='"+id+"'>"+title+"</option>";
                    }
                });
                cityHtml="<option value='' selected=''>全部</option>"+cityHtml;

                $("#city").html("");
                $("#city").append(cityHtml);
            }
            //搜索值
            var benjin = '<?= $moneyID = Yii::$app->request->get('principal',0);?>';
            var zichanbaobei = '<?= $categoryID = Yii::$app->request->get('category',0);?>';
            var dangqianzhuantian = '<?= $packageStateID = Yii::$app->request->get('packageState',0);?>';
            var zichanleixing = '<?= $packageTypeID =  Yii::$app->request->get('packageType',0);?>';
            $("#city").change(function(){
                city = $(this).val();
            });
            $("#benjin").change(function(){
                benjin = $(this).val();
            });
            $("#zichanbaoleixing").change(function(){
                zichanbaobei = $(this).val();
            });
            $("#dangqianzhuantian").change(function(){
                dangqianzhuantian = $(this).val();
            });
            $("#zichanleixing").change(function () {
                zichanleixing = $(this).val();
            })
            $(document).keydown(function(event) {
                if (event.keyCode == 13) {
                    $(".inputT").click();
                }
            })
            $("#reset").click(function () {
                window.location.href = "/search-package/search";
            })
            //搜索按钮搜索
                $(".inputT,.pageNum,.searchImg").click(function () {
                var pageNumThis = $(this).text();
                showNumOne = pageNumThis==''?pageNumOne:pageNumThis;
                    var tuandui = $("#tuandui").val()==''?'':$("#tuandui").val();
                    var charge = $("#charge").val()==''?'':$("#charge").val();
                var shangchuanren = $("#shangchuanren").val()==''?'':$("#shangchuanren").val();
                var zongjian = $("#zongjian").val()==''?'':$("#zongjian").val();
                var keywords = $(".search").val()==''?'':$(".search").val();
                var provinceId = province  != 0 ? province :getProvinceID;
                var url = "/search-package/search/?keyWords="+keywords+"&principal="+benjin+'&category='+zichanbaobei+"&packageState="+dangqianzhuantian+"&packageType="+zichanleixing+"&owner="+shangchuanren+"&teams="+tuandui+"&leader="+zongjian+"&province="+provinceId+"&city="+city+'&limit='+showNumOne+'&charge='+charge;
                window.location.href = url;
                // console.log(url);
            })
            //联想数据
            $(".search").focus();
            $(".search").on("keyup",function(e){
                $this = $(this);
                last = e.timeStamp;
                setTimeout(function(){
                    // console.log(e.timeStamp);
                    var $data_data = $this.val();
                    if(last-e.timeStamp===0){
                        $.ajax({
                            type:"get",
                            url:"/search-package/ajax-keywords",
                            data:{
                                keywods:$data_data
                            },
                            success:function(data){
                                var josnData = JSON.parse( data );
                                if(josnData.code == 200 && josnData.data.count > 0){
                                    titleKeywords(josnData.data.res)
                                }
                            },
                            onerror:function(){
                                console.log("not ok");
                            }
                        })
                    }
                },1000)
            })
            function titleKeywords(data) {
                var listHtml = '';
                $(data).each(function(i,e){
                    var title = e.title;
                    var id    = e.id;
                    if (i>10){
                        return;
                    }
                    listHtml+= "<option>"+title+"</option>";
                });
                $("#assetPackageTitle option").remove();
                $("#assetPackageTitle").append(listHtml);
            }
            //------------------------------申请访问----fly------------------
            $(".fangwenSQ").click(function () {
                var package_id = $(this).data('packageid');
                var title = $(this).data('title');
                $("#packageId").val(package_id)
                $("#shenqingFW").modal();
                $("#title").val(title)
            })

            $("#saveFWAccess").click(function () {
                var shenqingFWNote = $("#shenqingFWNote").val();
                var packageId = $("#packageId").val();
                var title = $("#title").val();

                var url = '/package-apply/access-apply'
                if (shenqingFWNote!=''){
                $.post(url,{'packageId':packageId,'shenqingFWNote':shenqingFWNote,'title':title,'group':1},function (res) {
                    resData = JSON.parse(res)
                    layer.msg(resData.message)
                    if (resData.code == 200){
                        $("#shenqingFW").modal('hide');
                    }
                })
                }else{
                    layer.msg('请填写访问申请理由');
                }

            })
            //------------------------------申请访问----fly------------------

            $('#city').select2({
                language: "zh-CN",  //设置 提示语言
                width: '100px', //设置下拉框的宽度
                tokenSeparators: [',', ' '],
                placeholder: "全部",  //提示语
                //maximumSelectionLength :30,   //限制搜索的个数
                tags: false                //可以手动添加，若限制手动添加，设置为false
            })

            $('#province').select2({
                language: "zh-CN",  //设置 提示语言
                width: '100', //设置下拉框的宽度
                tokenSeparators: [',', ' '],
                placeholder: "全部",  //提示语
                //maximumSelectionLength :30,   //限制搜索的个数
                tags: false                //可以手动添加，若限制手动添加，设置为false
            })
		});

        function orderGroup(valOrder) {
            var valOrderGet = '<?=  Yii::$app->request->get('orderGroup',0);?>';
            if (valOrder==1&&valOrder==valOrderGet){
                valOrder = 2;
            }
            if (valOrder==3&&valOrder==valOrderGet){
                valOrder = 4;
            }
            if (valOrder==5&&valOrder==valOrderGet){
                valOrder = 6;
            }
            if (valOrder==7&&valOrder==valOrderGet){
                valOrder = 8;
            }
            if (valOrder==9&&valOrder==valOrderGet){
                valOrder = 10;
            }
            if (valOrder==11&&valOrder==valOrderGet){
                valOrder = 12;
            }
            if (valOrder==13&&valOrder==valOrderGet){
                valOrder = 14;
            }
            if (valOrder==15&&valOrder==valOrderGet){
                valOrder = 16;
            }
            if (valOrder==17&&valOrder==valOrderGet){
                valOrder = 18;
            }
            var showNumOne = '<?=  Yii::$app->request->get('limit',10);?>';
            var tuandui ='<?=  Yii::$app->request->get('teams',"");?>';
            var charge ='<?=  Yii::$app->request->get('charge',"");?>';
            var shangchuanren = '<?=  Yii::$app->request->get('owner',"");?>';
            var zongjian ='<?=  Yii::$app->request->get('leader',"");?>';
            var keywords = '<?=  Yii::$app->request->get('keyWords','');?>';

            var benjin = '<?=  Yii::$app->request->get('principal',0);?>';
            var zichanbaobei = '<?=  Yii::$app->request->get('category',0);?>';
            var dangqianzhuantian = '<?=  Yii::$app->request->get('packageState',0);?>';
            var zichanleixing = '<?=   Yii::$app->request->get('packageType',0);?>';
            var cityID = '<?=    Yii::$app->request->get('city',0);?>';
            var provinceIDO = '<?=   Yii::$app->request->get('province',0);?>';

            var url = "/search-package/search/?keyWords="+keywords+"&principal="+benjin+'&category='+zichanbaobei+"&packageState="+dangqianzhuantian+"&packageType="+zichanleixing+"&owner="+shangchuanren+"&teams="+tuandui+"&leader="+zongjian+"&province="+provinceIDO+"&city="+cityID+'&limit='+showNumOne+'&charge='+charge+'&orderGroup='+valOrder;
            window.location.href = url;
        }
		
		

	</script>
